Telegram Group & Telegram Channel
یک ابزار داریم (روی Rust) که توی چندتا بخش نیاز به پردازش یک سری header های درخواستی که میاد داره.
یا مثلا بعضی جاها کاربر می‌تونه permission هارو باهاشون کار کنه و ...

همیشه خیلی سریع پردازش انجام می‌شد و تمام؛ دیروز یکی از مشتری‌ها اعلام کرد که ابزار خیلی کند شده (برای یک سرور خاص البته) بعد از کلی بررسی متوجه شدم :

تعداد فایل‌هایی که روی این سرور دارند خیلی خیلی زیاد هست ولی چون حجم خیلی خیلی پایینی داره اکثرا و توی یک هارد کوچیک جا شده؛ مشتری توقع داره سرعت بالاتر باشه.
نسبت به سروری که مثلا ۵۰۰ تا فایل ۱۰ گیگ داره.

حدودا ۳۲-۳۴٪ سرعت با تغییر operator های معمولی چک کردن هدر و پردازش permission, .... به Bitwise operator بدست اومد.
گفتم یک مثال هم اینجا بزنم؛ فقط توی این مثال به چندتا چیز توجه کنید:

۱- زوج بودن عدد محاسبات سنگینی نداره هرچند؛ محاسبه باقی‌مانده از AND گرفتن سنگین تر هست.

۲- پایتون زبان سطح بالاس؛ محاسبه باقی مانده و AND سربارهای پایتونی داره که باعث میشه تفاوت کمتر بشه و CPython هم بسیار اپتیمایز شده هست.

۳- مثال خیلی ساده هست.

با این حال مفهوم رو آموزش میده و تفاوت اندک هم میشه دید.
👍184



tg-me.com/pyHints/846
Create:
Last Update:

یک ابزار داریم (روی Rust) که توی چندتا بخش نیاز به پردازش یک سری header های درخواستی که میاد داره.
یا مثلا بعضی جاها کاربر می‌تونه permission هارو باهاشون کار کنه و ...

همیشه خیلی سریع پردازش انجام می‌شد و تمام؛ دیروز یکی از مشتری‌ها اعلام کرد که ابزار خیلی کند شده (برای یک سرور خاص البته) بعد از کلی بررسی متوجه شدم :

تعداد فایل‌هایی که روی این سرور دارند خیلی خیلی زیاد هست ولی چون حجم خیلی خیلی پایینی داره اکثرا و توی یک هارد کوچیک جا شده؛ مشتری توقع داره سرعت بالاتر باشه.
نسبت به سروری که مثلا ۵۰۰ تا فایل ۱۰ گیگ داره.

حدودا ۳۲-۳۴٪ سرعت با تغییر operator های معمولی چک کردن هدر و پردازش permission, .... به Bitwise operator بدست اومد.
گفتم یک مثال هم اینجا بزنم؛ فقط توی این مثال به چندتا چیز توجه کنید:

۱- زوج بودن عدد محاسبات سنگینی نداره هرچند؛ محاسبه باقی‌مانده از AND گرفتن سنگین تر هست.

۲- پایتون زبان سطح بالاس؛ محاسبه باقی مانده و AND سربارهای پایتونی داره که باعث میشه تفاوت کمتر بشه و CPython هم بسیار اپتیمایز شده هست.

۳- مثال خیلی ساده هست.

با این حال مفهوم رو آموزش میده و تفاوت اندک هم میشه دید.

BY Python Hints




Share with your friend now:
tg-me.com/pyHints/846

View MORE
Open in Telegram


Python Hints Telegram | DID YOU KNOW?

Date: |

How Does Bitcoin Work?

Bitcoin is built on a distributed digital record called a blockchain. As the name implies, blockchain is a linked body of data, made up of units called blocks that contain information about each and every transaction, including date and time, total value, buyer and seller, and a unique identifying code for each exchange. Entries are strung together in chronological order, creating a digital chain of blocks. “Once a block is added to the blockchain, it becomes accessible to anyone who wishes to view it, acting as a public ledger of cryptocurrency transactions,” says Stacey Harris, consultant for Pelicoin, a network of cryptocurrency ATMs. Blockchain is decentralized, which means it’s not controlled by any one organization. “It’s like a Google Doc that anyone can work on,” says Buchi Okoro, CEO and co-founder of African cryptocurrency exchange Quidax. “Nobody owns it, but anyone who has a link can contribute to it. And as different people update it, your copy also gets updated.”

How to Use Bitcoin?

n the U.S. people generally use Bitcoin as an alternative investment, helping diversify a portfolio apart from stocks and bonds. You can also use Bitcoin to make purchases, but the number of vendors that accept the cryptocurrency is still limited. Big companies that accept Bitcoin include Overstock, AT&T and Twitch. You may also find that some small local retailers or certain websites take Bitcoin, but you’ll have to do some digging. That said, PayPal has announced that it will enable cryptocurrency as a funding source for purchases this year, financing purchases by automatically converting crypto holdings to fiat currency for users. “They have 346 million users and they’re connected to 26 million merchants,” says Spencer Montgomery, founder of Uinta Crypto Consulting. “It’s huge.”

Python Hints from nl


Telegram Python Hints
FROM USA